package sun.superstring.interface2;

public class Test {
    public static void main(String[] args) {
        // 目标：理解java设计接口的好处、用处
        // 弥补了类单继承的不足，一个类可以同时实现多个接口，使得类的角色更多，功能更强大
        People people = new Student();
        Driver driver = new Student();  // 多态
        BoyFriend b = new Student();

        // 让程序可以面向接口编程，更利于解耦合
        Driver a = new Teacher();
        BoyFriend b1 = new Student();
    }
}

interface Driver{}
interface BoyFriend{}

class People{}

class Student extends People implements Driver, BoyFriend{}

class Teacher implements Driver, BoyFriend{}